package com.mfin.bom.objects;

// Generated 17 Jun, 2012 11:27:33 PM by Hibernate Tools 3.4.0.CR1

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * DocCharge generated by hbm2java
 */
@Entity
@Table(name = "doc_charge", catalog = "mfindb")
public class DocCharge implements java.io.Serializable {

	private Long id;
	private LoanPreference loanPreference;
	private Finance finance;
	private LoanMaster loanMaster;
	private Double rangeMin;
	private Double rangeMax;
	private Double charges;

	public DocCharge() {
	}

	public DocCharge(LoanPreference loanPreference, Finance finance,
			LoanMaster loanMaster, Double rangeMin, Double rangeMax,
			Double charges) {
		this.loanPreference = loanPreference;
		this.finance = finance;
		this.loanMaster = loanMaster;
		this.rangeMin = rangeMin;
		this.rangeMax = rangeMax;
		this.charges = charges;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({
			@JoinColumn(name = "LOAN_TYPE", referencedColumnName = "LOAN_TYPE"),
			@JoinColumn(name = "FINANCE_ID", referencedColumnName = "FINANCE_ID") })
	public LoanPreference getLoanPreference() {
		return this.loanPreference;
	}

	public void setLoanPreference(LoanPreference loanPreference) {
		this.loanPreference = loanPreference;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "FINANCE_ID", insertable = false, updatable = false)
	public Finance getFinance() {
		return this.finance;
	}

	public void setFinance(Finance finance) {
		this.finance = finance;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "LOAN_TYPE", insertable = false, updatable = false)
	public LoanMaster getLoanMaster() {
		return this.loanMaster;
	}

	public void setLoanMaster(LoanMaster loanMaster) {
		this.loanMaster = loanMaster;
	}

	@Column(name = "RANGE_MIN", precision = 22, scale = 0)
	public Double getRangeMin() {
		return this.rangeMin;
	}

	public void setRangeMin(Double rangeMin) {
		this.rangeMin = rangeMin;
	}

	@Column(name = "RANGE_MAX", precision = 22, scale = 0)
	public Double getRangeMax() {
		return this.rangeMax;
	}

	public void setRangeMax(Double rangeMax) {
		this.rangeMax = rangeMax;
	}

	@Column(name = "CHARGES", precision = 22, scale = 0)
	public Double getCharges() {
		return this.charges;
	}

	public void setCharges(Double charges) {
		this.charges = charges;
	}

}
